package main

import "fmt"

func solution(S string) int {
	charCount := make(map[rune]int)
	for _, char := range S {
		charCount[char]++
	}

	res := 0

	for _, v := range charCount {
		res = res + v/2
	}

	return res

}

func main() {
	fmt.Println(solution("abab") == 2)
	fmt.Println(solution("aaaa") == 2)
	fmt.Println(solution("abcabc") == 3)
}
